{% extends "default/sell/signup_wizard_base.html" %}

{% load i18n %}

{% block step %}
<form name="form" method="post" action="." class="form-stacked span10 offset2">
	
	{% csrf_token %}
	{% for field in form %}
	{% if field.errors %}<div class="alert-message block-message error">{{ field.errors|join:", " }}</div>{% endif %}
	<label>{{ field.label }}</label>
	{{ field }} {{ field.help_text }}
	{% endfor %}
	<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
	{{ previous_fields|safe }}
	<div class="buttonHolder">
		<button type="submit" class="btn primary">{% trans "Next" %}</button>
       	<input type="hidden" name="next" value="{{ next|escape }}" />
    </div>
	
</form>

<style>
#id_0-shop_name {
	width: 150px;
}
</style>

<script type="text/javascript"> 
$("#id_0-name_store").keyup(function(e){
    var name = $(this).val();
   	$("#id_0-shop_name").val(name.toLowerCase().replace(/[^a-z0-9-]/ig, ''));
}); 

$("#id_0-shop_name").change(function(){
	var name = $(this).val();
	$(this).val(name.toLowerCase().replace(/[^a-z0-9-]/ig, ''));
});

$("#id_0-last_name").attr("value", "{{ user.last_name }}");
$("#id_0-first_name").attr("value", "{{ user.first_name }}");

</script> 
{% endblock %}

